package cn.springsoter.core.prometheus.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.micrometer.core.instrument.MeterRegistry;
import lombok.Getter;
import lombok.Setter;

/**
 * MybatisPlus config
 * 
 * @author kevin
 */
@Getter
@Setter
@Configuration
public class PrometheusConfig {
	
	@Value("${spring.application.name:springsoter}")
	private String appName;
	
	@Bean
	MeterRegistryCustomizer<MeterRegistry> metricsCommonTags() {
	  return registry -> registry.config().commonTags("application", appName, "instance", appName);
	}
}
